home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / shmop.man < prev    next >
Encoding:
Text File  |  1991-07-02  |  4.8 KB  |  133 lines

  1.  
  2.  
  3.  
  4. SHMOP                 C Library Procedures                  SHMOP
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      shmop, shmat, shmdt - shared memory operations
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
  13.      ##iinncclluuddee <<ssyyss//iippcc..hh>>
  14.      ##iinncclluuddee <<ssyyss//sshhmm..hh>>
  15.  
  16.      cchhaarr **sshhmmaatt((sshhmmiidd,, sshhmmaaddddrr,, sshhmmffllgg))
  17.      iinntt sshhmmiidd;;
  18.      cchhaarr **sshhmmaaddddrr;;
  19.      iinntt sshhmmffllgg;;
  20.  
  21.      iinntt sshhmmddtt((sshhmmaaddddrr))
  22.      cchhaarr **sshhmmaaddddrr;;
  23.  
  24. DDEESSCCRRIIPPTTIIOONN
  25.      sshhmmaatt(()) maps the shared memory segment associated with the
  26.      shared memory identifier specified by _s_h_m_i_d into the data
  27.      segment of the calling process.  Upon successful completion,
  28.      the address of the mapped segment is returned.
  29.  
  30.      The shared memory segment is mapped at the address specified
  31.      by one of the following criteria:
  32.  
  33.      o+    If _s_h_m_a_d_d_r is equal to zero, the segment is mapped at
  34.           an address selected by the system.  Ordinarily, appli-
  35.           cations should invoke sshhmmaatt(()) with _s_h_m_a_d_d_r equal to
  36.           zero so that the operating system may make the best use
  37.           of available resources.
  38.  
  39.      o+    If _s_h_m_a_d_d_r is not equal to zero and (_s_h_m_f_l_g & SSHHMM__RRNNDD)
  40.           is ``true'', the segment is mapped at the address given
  41.           by (_s_h_m_a_d_d_r - (_s_h_m_a_d_d_r modulus SSHHMMLLBBAA)).
  42.  
  43.      o+    If _s_h_m_a_d_d_r is not equal to zero and (_s_h_m_f_l_g & SSHHMM__RRNNDD)
  44.           is ``false'', the segment is mapped at the address
  45.           given by _s_h_m_a_d_d_r.
  46.  
  47.      The segment is mapped for reading if (_s_h_m_f_l_g & SSHHMM__RRDDOONNLLYY)
  48.      is ``true'' {{RREEAADD}}, otherwise it is mapped for reading and
  49.      writing {{RREEAADD//WWRRIITTEE}}.
  50.  
  51.      sshhmmddtt(()) unmaps from the calling process's address space the
  52.      shared memory segment that is mapped at the address speci-
  53.      fied by _s_h_m_a_d_d_r.  The shared memory segment must have been
  54.      mapped with a prior sshhmmaatt(()) function call.  The segment and
  55.      contents are retained until explicitly removed by means of
  56.      the function (see sshhmmccttll(2)).
  57.  
  58. RREETTUURRNN VVAALLUUEESS
  59.      Upon successful completion, the return values are as
  60.  
  61.  
  62.  
  63. Sprite v1.0             21 November 1987                        1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SHMOP                 C Library Procedures                  SHMOP
  71.  
  72.  
  73.  
  74.      follows:
  75.  
  76.      o+    sshhmmaatt(()) returns the data segment start address of the
  77.           mapped shared memory segment.
  78.  
  79.      o+    sshhmmddtt(()) returns a value of 0.
  80.  
  81.      Otherwise, a value of -1 is returned and eerrrrnnoo is set to
  82.      indicate the error.
  83.  
  84. EERRRROORRSS
  85.      sshhmmaatt(()) will fail and not map the shared memory segment if
  86.      one or more of the following are true:
  87.  
  88.      EINVAL              _s_h_m_i_d is not a valid shared memory iden-
  89.                          tifier.
  90.  
  91.      EACCES              Operation permission is denied to the
  92.                          calling process (see iinnttrroo(2)).
  93.  
  94.      ENOMEM              The available data space is not large
  95.                          enough to accommodate the shared memory
  96.                          segment.
  97.  
  98.      EINVAL              _s_h_m_a_d_d_r is not equal to zero, and the
  99.                          value of (_s_h_m_a_d_d_r - (_s_h_m_a_d_d_r modulus
  100.                          SSHHMMLLBBAA)) is an illegal address.
  101.  
  102.      EINVAL              _s_h_m_a_d_d_r is not equal to zero, (_s_h_m_f_l_g &
  103.                          SSHHMM__RRNNDD) is ``false'', and the value of
  104.                          _s_h_m_a_d_d_r is an illegal address.
  105.  
  106.      EMFILE              The number of shared memory segments
  107.                          mapped to the calling process would
  108.                          exceed the system-imposed limit.
  109.  
  110.      sshhmmddtt(()) will fail and not unmap the shared memory segment
  111.      if:
  112.  
  113.      EINVAL
  114.           _s_h_m_a_d_d_r is not the data segment start address of a
  115.           shared memory segment.
  116.  
  117. SSEEEE AALLSSOO
  118.      eexxeeccvvee(2), eexxiitt(2), ffoorrkk(2), iinnttrroo(2), sshhmmccttll(2), sshhmmggeett(2)
  119.  
  120. BBUUGGSS
  121.      The System V shared memory functions are implemented at user
  122.      level on top of the mmap(2) interface.  Not all the System V
  123.      functionality is implemented.
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0             21 November 1987                        2
  130.  
  131.  
  132.  
  133.